<?php
require_once '../../controller/vagas/' . basename(__FILE__);
$pagina[0] = array('Contratos', '../../view/contratos/pesquisar.php');
$pagina[1] = array('Editar Contrato', '../../view/contratos/cadastrar.php?id=' . $_GET['contratoid'] );
$pagina[2] = array('Vagas');
require_once '../../template/header.php';
?>
<ul class="navmenu">
	<li><a class="voltar" href="../contratos/cadastrar.php?id=<?php echo $_GET['contratoid'] ?>">Voltar</a></li>
	<?php require_once '../contratos/helper_abas.php'; ?>
</ul>
<div id="conteudo">
<?php TMensagens::exibirStatus($erro, $sucesso, $info) ?>
<?php require_once '../contratos/helper_brevidade.php' ?>
<?php SInfoContrato::gerarCabecalho( $contrato ) ?>
<?php require_once '../contratos/helper_situacao.php'; ?>
<?php if($flagExcluir):?>
<form method="post" action="<?php echo basename(__FILE__) . '?contratoid=' . $_GET['contratoid'] ?>">
<?php endif;?>
<?php if($flagExcluir):?>
</form>
<?php endif;?>
<?php if ($readOnly == ''): ?>
	<form method="post" action="<?php echo basename(__FILE__) . '?contratoid=' . $_GET['contratoid'] ?>">
		<fieldset>
			<legend>Inserir</legend>
			<table>
				<tr>
					<td>Cargo</td>
					<td><select name="ddlCargoID" class="textoGrande">
					<?php TSelect::MontaDropDownList(Listas::RetornarCargos(), $objeto->cargoid ); ?>
					</select></td>
				</tr>
				<tr>
					<td>Quantidade</td>
					<td><input type="text" name="txtQuantidade" class="textoPequeno"
						value="<?php if( isset($objeto->vagaid) ) echo $vaga->getTotalPorCargoContrato() ?>" /></td>
				</tr>
			</table>
			<p class="botoeira">
				<button type="submit" name="btnAcao" value="Salvar">Inserir</button>
			</p>
		</fieldset>
	</form>
	<form method="post"	action="<?php echo basename(__FILE__) . '?contratoid=' . $_GET['contratoid'] ?>">
		<p>
			<label>Quantidade: </label>
			<input type="text" name="txtQuantidade" class="maskNumeros opcional"/>&nbsp;
			<input type="submit" name="btnAcao" title="Excluir" value="Excluir"
			onclick="javascript: return confirm('Deseja realmente excluir os itens selecionados?');" />
		</p>
		<?php 
			$d = new TDataTableContratoVagas($contratoid, array('radioColumn'=>TRUE,'checkColumn'=>FALSE,'editColumn'=>FALSE,'searchGrid'=>FALSE, 'itensPerPage' => 30));
			echo $d->render();			
		?>
	</form>
<?php else: ?>
	<form method="post" action="<?php echo basename(__FILE__) . '?contratoid=' . $_GET['contratoid'] ?>">
    	<?php 
			$d = new TDataTableContratoVagas($contratoid, array('checkColumn'=>FALSE, 'editColumn'=>FALSE,'searchGrid'=>FALSE, 'itensPerPage' => 30));
			echo $d->render();
		?>
    </form>
<?php endif; ?>
</div>
		<?php require_once ('../../template/footer.php'); ?>